From: Paul Eggert Date: Tue, 21 Jun 2011 01:30:32 +0000 (-0700) Subject: * xdisp.c (display_mode_element): Don't assume strlen fits in int. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~3371^2~14 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=237f15bf3fa738bf6366ff20bfcca7f1fe3e8b3a;p=emacs.git * xdisp.c (display_mode_element): Don't assume strlen fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6cfbf5db98d..96bca491f88 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,7 @@ not unsigned long, as we prefer signed integers. All callers changed. Detect integer overflow in repeat count. (message_dolog): Don't assume print length fits in 39 bytes. + (display_mode_element): Don't assume strlen fits in int. * termcap.c: Don't assume sizes fit in int and never overflow. (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes. diff --git a/src/xdisp.c b/src/xdisp.c index ce60b658a73..ae5c334447d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18730,8 +18730,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, break; case MODE_LINE_STRING: { - int len = strlen (spec); - Lisp_Object tem = make_string (spec, len); + Lisp_Object tem = build_string (spec); props = Ftext_properties_at (make_number (charpos), elt); /* Should only keep face property in props */ n += store_mode_line_string (NULL, tem, 0, field, prec, props);